//
//  ZGSHotCell.m
//  Tour
//
//  Created by dllo on 15/10/28.
//  Copyright (c) 2015年 蓝鸥科技. All rights reserved.
//

#import "ZGSHotCell.h"
#define HEIGHT self.contentView.frame.size.height
#define WIDTH self.contentView.frame.size.width
@implementation ZGSHotCell

- (void)dealloc{
    [_leftImage release];
    [_labelGo release];
    [_labelLike release];
    [_labelName release];
    [super dealloc];
}

- (void)awakeFromNib {
    // Initialization code
}

- (void)setSelected:(BOOL)selected animated:(BOOL)animated {
    [super setSelected:selected animated:animated];

    // Configure the view for the selected state
}

- (instancetype)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reuseIdentifier{
    self = [super initWithStyle:style reuseIdentifier:reuseIdentifier];
    if (self) {
        [self creatView];
    }
    return self;
}

- (void)creatView{
    self.leftImage = [[UIImageView alloc] init];
//    self.leftImage.layer.borderWidth = 1;
    [self.contentView addSubview:self.leftImage];
    self.labelName = [[UILabel alloc] init];
//    self.labelName.layer.borderWidth = 1;
    [self.contentView addSubview:self.labelName];
    self.labelLike = [[UILabel alloc] init];
//    self.labelLike.layer.borderWidth = 1;
    [self.contentView addSubview:self.labelLike];
    self.labelGo = [[UILabel alloc] init];
//    self.labelGo.layer.borderWidth = 1;
    [self.contentView addSubview:self.labelGo];
    

}

- (void)layoutSubviews{
    [super layoutSubviews];
    self.leftImage.frame = CGRectMake(5, 5, self.contentView.frame.size.width / 3, self.contentView.frame.size.height - 10);
    self.labelName.frame = CGRectMake(WIDTH / 3 + 10, 5, WIDTH / 3 * 2 - 10, HEIGHT / 3 + 10);
    self.labelName.font = [UIFont systemFontOfSize:20];
    self.labelLike.frame = CGRectMake(WIDTH / 3 + 10, 30 + HEIGHT / 3, WIDTH / 3 * 2 - 15, 20);
    self.labelLike.font = [UIFont systemFontOfSize:14];
      self.labelGo.frame = CGRectMake(WIDTH / 3 + 10, 30 + HEIGHT / 3 + 35, WIDTH / 3 * 2 - 10, 10);
    self.labelGo.font = [UIFont systemFontOfSize:14];

    
}
#if 0
+(CGFloat)HeightWithText:(NSString *)text width:(CGFloat)width font:(UIFont *)font{
    // 设置Label大小
    CGSize size = CGSizeMake(width, 3000);
    
    // 写自适应的方法
    CGRect rect = [text boundingRectWithSize:size options:NSStringDrawingUsesLineFragmentOrigin attributes:@{NSFontAttributeName:font} context:nil];
    
    return rect.size.height;
}
#endif
@end
